find the total distance traveled particle motion